Session Variable
Session variables can be preserved in any ongoing leg in the session, for example, in an call session with forking calls, in a call which had a locally handled blind transfer, etc. The value of the variable remains the same in all existing legs and in new legs of the session context.
Syntax:
var.session.<Variable Name>
where, <Variable Name> specifies the name of the variable.
For example (using SIPRec):
For an IP-to-Tel call, the INVITE message of the recorded IP call contains the header, X-credit-card (e.g., X-credit-card: 123456789). When the device sends an INVITE to the SIPRec server (SRS), it is required to include the content (value) of this header (e.g., 123456789). To do this, you need to configure two Message Manipulation rules:
1. | For the recorded call: This rule stores the content of the X-credit-card header in the variable, var.session.SIPRec. |
2. | For the SRS leg: This rule adds a new header, X-credit-card with the contents of the variable (var.session.SIPRec) to the INVITE sent to the SRS. |
Example of Session Variables
Message Type |
Condition |
Action |
Action Type |
Action Value |
Description |
---|---|---|---|---|---|
invite.request |
header.X-credit-card exists |
var.session.SIPRec |
Modify |
header.X-credit-card |
For the recorded call |
invite.request |
var.session.SIPRec != '' |
header.X-credit-card |
Add |
var.session.SIPRec |
For the SRS leg |